<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.nuc.kl.module.usermanager.*"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP '003.jsp' starting page</title>
    
	<%@include file="/WEB-INF/jsp/public/commons.jspf" %>
	
	
	<script type="text/javascript">
		$(function(){

			$('.btn2').click(function(){
				$('.easyui-dialog').dialog('close');
			});
			
			 var peopleFlag=<%=session.getAttribute("peopleFlag")%>;
			 if(peopleFlag == 1){
				// 自定义的校验器
					$.extend($.fn.validatebox.defaults.rules, {   
		    				midLength: {   
		       			 			validator: function(value, param){   
		            								return value.length >= param[0] && value.length <= param[1];    
		        					},   
		        					message: ''  
							} ,
							equalLength : {
		       			 			validator: function(value, param){   
		            								return value.length == param[0];    
		        					},   
		        					message: '电话号码必须为11位!'  
							}
					}); 
				 
				$("#user").dialog({   
					close:false  
				});  


			}else if(peopleFlag == 2){
				$("#teacher").dialog({   
					close:false  
				});  
			}else{
				$.extend($.fn.validatebox.defaults.rules, {   
    				midLength: {   
       			 			validator: function(value, param){   
            								return value.length >= param[0] && value.length <= param[1];    
        					},   
        					message: ''  
					} ,
					equalLength : {
       			 			validator: function(value, param){   
            								return value.length == param[0];    
        					},   
        					message: '学号必须为10个字符!'  
					}
				}); 
				
			}

		});
	
	</script>
	
  </head>
  
  <body>
    	<div id="user" title="修改个人资料" modal=true  draggable=false class="easyui-panel" closed=true style="width:500px;height: 450px;">
	    		<form action="private_update.action" method="post">
	    				<input type="hidden" name="id"/>
	    				<table>
	    					<tr>
	    						<td>用户名:</td>
	    						<td><input type="text" name="name" class="easyui-validatebox" required=true validType="midLength[2,10]" missingMessage="用户名称必填!" invalidMessage="必须在2到10个字符之间!" value="<s:property value="#session.people.name"/>" /> </td>
	    					</tr>
	    					<tr>
	    						<td>登录名:</td>
	    						<td><input type="text" name="loginName" readonly="readonly" value="<s:property value="#session.people.loginName" />" /> </td>
	    					</tr> 
	    					<tr>
	    						<td>密码:</td>
	    						<td><input type="password" name="password" class="easyui-validatebox" required=true validType="midLength[6,18]" missingMessage="密码必填!" invalidMessage="必须在6到18个字符之间!" value="<s:property value="#session.people.name"/>"/> </td>
	    					</tr> 
	    					<tr>
	    						<td>性别:</td>
	    						<td>
	    						<input type="radio" name="gender" value="1" 
	    							<s:if test="#session.people.gender == 1" >
	    								checked=checked
	    							</s:if>
	    						
	    						/>男
	    						<input type="radio" name="gender" value="0"
	    							<s:if test="#session.people.gender == 0" >
	    								checked=checked
	    							</s:if>
	    						/>女
	    						</td>
	    					</tr> 
	    					<tr>
	    						<td>电话号码:</td>
	    						<td><input type="text" name="phoneNumber" class="easyui-validatebox" required=true validType="equalLength[11]" missingMessage="联系方式必填!" value="<s:property value="#session.people.phoneNumber"/>" /></td>
	    					</tr> 
	    					<tr>
	    						<td>电子邮件:</td>
	    						<td><input type="text" name="email"  class="easyui-validatebox" required=true validType="email" missingMessage="邮箱必填!" value="<s:property value="#session.people.email"/>" /></td>
	    					</tr> 
	    					
	    					<tr align="center">
	    						<td colspan="2">
	    							<input type="submit" class="easyui-linkbutton" value="确定" />
	    						</td>
	    					</tr>   					 					    					    					    					    					    					    					    					
	    				</table>
	    		</form> 			
 		</div>
 		
 		
    	
   		<div id="teacher" title="修改个人资料" modal=true  draggable=false class="easyui-panel" closed=true style="width:500px;height: 450px;">
	    		<form action="private_update.action" method="post">
	    				<input type="hidden" name="id"/>
	    				<table>
	    					<tr>
	    						<td>姓名:</td>
	    						<td><input type="text" name="name" class="easyui-validatebox" required=true validType="midLength[2,10]" missingMessage="用户名称!" invalidMessage="必须在2到10个字符之间!" value="<s:property value="#session.people.name"/>" /></td>
	    					</tr>
	    					<tr>
	    						<td>登录名:</td>
	    						<td><input type="text" name="loginName" readonly="readonly" value="<s:property value="#session.people.loginName"/>" /> </td>
	    					</tr> 
	    					<tr>
	    						<td>密码:</td>
	    						<td><input type="password" name="password" class="easyui-validatebox" required=true validType="midLength[6,18]" missingMessage="密码必填!" invalidMessage="必须在6到18个字符之间!"/> </td>
	    					</tr> 
	    					<tr>
	    						<td>学校:</td>
	    						<td>
	    						<input type="text" name="school" required=true  class="easyui-validatebox"  missingMessage="学校名称必填!" value="<s:property value="#people.school"/>" />
	    						
	    						</td>
	    					</tr> 
	    					<tr>
	    						<td>专家：</td>
	    						<td><input type="radio" name="isExpert" readonly="readonly"
	    							<s:if test="#people.isExpert == 1" >
	    								value="是" 
	    							</s:if>
	    						/>
	    						</td>
	    					</tr> 
	    					
	    					
	    					<tr align="center">
	    						<td colspan="2">
	    								<input type="submit" class="easyui-linkbutton" value="确定" />
	    						</td>
	    					</tr>   					 					    					    					    					    					    					    					    					
	    				</table>
	    		</form> 			
 			</div>
    	
    	
    	<div id="student" title="修改个人资料" modal=true  draggable=false class="easyui-panel" closed=true style="width:500px;height: 450px;">
	    		<form action="private_update.action" method="post">
	    				<input type="hidden" name="id"/>
	    				<table>
	    					<tr>
	    						<td>姓名:</td>
	    						<td><input type="text" name="name" class="easyui-validatebox" required=true validType="midLength[2,10]" missingMessage="用户名称!" invalidMessage="必须在2到10个字符之间!" value="<s:property value="#session.people.name"/>" /></td>
	    					</tr>
	    					<tr>
	    						<td>登录名:</td>
	    						<td><input type="text" name="loginName" readonly="readonly" value="<s:property value="#session.people.loginName"/>" /> </td>
	    					</tr> 
	    					<tr>
	    						<td>密码:</td>
	    						<td><input type="password" name="password" class="easyui-validatebox" required=true validType="midLength[6,18]" missingMessage="密码必填!" invalidMessage="必须在6到18个字符之间!" value="<s:property value="#session.people.password"/>"/> </td>
	    					</tr> 
	    					<tr>
	    						<td>学号:</td>
	    						<td>
	    						<input type="text" name="stuNum" required=true  class="easyui-combobox" validType="equalLength[10]" missingMessage="学号必填!" value=<s:property value="#people.stuNum"/>/>
	    						</td>
	    					</tr> 
	    					<tr>
	    						<td>入学年份:</td>
	    						<td><input type="text" class="easyui-DateBox" name="entryYear" required=true missingMessage="日期必填!" value=<s:property value="#people.entryYear"/> /></td>
	    					</tr> 
	    					
	    					
	    					<tr align="center">
	    						<td colspan="2">
	    							<input type="submit" class="easyui-linkbutton" value="确定" />
	    						</td>
	    					</tr>   					 					    					    					    					    					    					    					    					
	    				</table>
	    		</form> 			
 			</div>
    		
  </body>
</html>

